<template>
  <div class="seat">
    <div class="title">{{activityDetail.name}}</div>
    <div class="seat-check-in">
      <div class="seat-check-in-inner">
        <div class="seat-info">
          <div class="seat-info-num">{{activityDetail.seat_num}}</div>
          <div class="seat-info-text">您的座位</div>
        </div>
        <div class="detail-dress detai-list-public">
          <div class="detail-dress-info">
            <i class="detail-dress-icon detail-icon-public"></i>
            <span>{{activityDetail.province + activityDetail.city + activityDetail.area + activityDetail.address_detail}}</span>
          </div>
        </div>
        <div class="detail-time detai-list-public">
          <span class="detail-date-box">
            <i class="detail-icon detail-icon-public"></i>
            <span class="detail-date">{{activityDetail.start_time}} 至 {{activityDetail.end_time}}</span>
          </span>
        </div>
        <!-- <div class="seat-check-in-btn">
          <div class="code-check-in" @click="saoma">扫码签到</div>
          <div class="check-in-details">查看详情</div>
        </div> -->
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data(){
    return{
      activityID:'',
      activityDetail:[],
    }
  },
  onLoad(option) {
    this.activityID = option.id;
  },
  onShow(){
    this.reqActivityDetail(this.activityID);
  },
  methods:{
    //通过传递过来的参数获取活动数据
    async reqActivityDetail(id){
      var userToken = wx.getStorageSync('userToken');
      let params = { 
        activity_id: id,
        user_token: userToken 
      };
      let res = await this.$api.getActivityDtail(params);
      wx.stopPullDownRefresh()
      if(res.data.level == "success"){
        this.activityDetail = res.data.data
      }else{
        wx.showToast({
          title: '获取内容失败',
          icon: 'none',
          duration: 1000
        })
      }
    },
  }
}
</script>

<style lang="scss" scoped>
  .seat{
    .title{
      height: 80rpx;
      line-height: 80rpx;
      font-weight: 600;
      text-align: center;
    }
    .seat-check-in{
      display: flex;
      justify-content: center;
      align-items: center;
      border: 1px solid rgb(110, 189, 235);
      border-radius: 10px;
      padding: 40rpx 0;
      margin-top: 20rpx;
      .seat-check-in-inner{
        width: 80%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
      }
      .seat-info{
        width: 200rpx;
        .seat-info-num{
          height: 200rpx;
          text-align: center;
          line-height: 200rpx;
          border-radius: 50%;
          color: #ffffff;
          background-color: rgb(110, 189, 235);
        }
        .seat-info-text{
          height: 70rpx;
          line-height: 70rpx;
          text-align: center;
          font-size: 34rpx;
          color: #333333;
        }
      }
      // .seat-check-in-btn{
      //   margin-top: 20rpx;
      //   width: 100%;
      //   display: flex;
      //   justify-content: space-around;
      //   align-items: center;
      //   >div{
      //     font-size: 32rpx;
      //     border-radius: 6px;
      //     color: #ffffff;
      //     padding: 20rpx 30rpx;
      //     background-color: rgb(110, 189, 235);
      //   }
      // }

    }
  }
  .detail-dress{
    font-size: 24rpx;
    justify-content: space-between;
    .detail-dress-info{
      display: flex;
      align-items: center;
      .detail-dress-icon{
        background-image: url(../../../../static/images/position.png);
      }
    }
  }
  .detail-time{
    margin-top:20rpx;
    font-size: 24rpx;
    .detail-date-box{
      display: flex;
      justify-content: center;
      align-items: center;
      .detail-icon{
        background-image: url(../../../../static/images/time.png);
      }
    }
  }
</style>